<!DOCTYPE HTML>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<meta charset="utf-8">
<head th:include="include :: header"></head>
<body class="gray-bg">

		<div class="container-div ui-layout-center">
			<div class="row">
				<div class="col-sm-12 select-info">
					<form id="user-form">
						<input type="hidden" id="deptId" name="deptId">
						<input type="hidden" id="parentId" name="parentId">
						<div class="select-list">
							<ul>
								<li>
									手机名称：<input type="text" name="name"/>
								</li>
								<li>
									手机品牌：<select name="type" th:with="type=${@dicts.findPhoneType()}">
									<option value="">全部</option>
									<option th:each="dict : ${type}" th:text="${dict.type}" th:value="${dict.type}"></option>
								</select>
								</li>
								<li>
									<label>低于价格： </label>
									<input type="text" placeholder="软妹币" name="price"/>
								</li>
								<li>
									<a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i class="fa fa-search"></i>&nbsp;搜索</a>

								</li>
							</ul>
						</div>
					</form>
				</div>



    <div class="container-div">
		<div class="btn-group hidden-xs" id="toolbar" role="group">
			<a class="btn btn-outline btn-success btn-rounded" onclick="$.operate.add()" shiro:hasPermission="module:phone:add">
				<i class="fa fa-plus"></i> 新增
			</a>
			<a class="btn btn-outline btn-danger btn-rounded" onclick="$.operate.removeAll()" shiro:hasPermission="module:phone:remove">
				<i class="fa fa-trash-o"></i> 删除
			</a>
		</div>
			
		<div class="col-sm-12 select-table table-striped">
			<table id="bootstrap-table" data-mobile-responsive="true"></table>
		</div>
    </div>
    <div th:include="include :: footer"></div>
    <script th:inline="javascript">
        var editFlag = [[${@permission.hasPermi('module:phone:edit')}]];
        var removeFlag = [[${@permission.hasPermi('module:phone:remove')}]];
        var prefix = ctx + "module/phone"

        $(function() {
            var options = {
                url: prefix + "/list",
                createUrl: prefix + "/add",
                updateUrl: prefix + "/edit/{id}",
                removeUrl: prefix + "/remove",
                modalName: "手机",
                columns: [{
		            checkbox: true
		        },
				{
					field : 'phoneId', 
					title : '文章ID' 
				},
				{
					field : 'name', 
					title : '手机型号' 
				},
				{
					field : 'type', 
					title : '手机品牌' 
				},
				{
					field : 'price', 
					title : '手机价格' 
				},
				{
					field : 'score', 
					title : '手机跑分' 
				},
				{
					field : 'beginTime', 
					title : '手机出厂时间' 
				},
				{
					field : 'size', 
					title : '手机尺寸' 
				},
				{
					field : 'px', 
					title : '像素' 
				},
				{
					field : 'battery', 
					title : '电池' 
				},
				{
					field : 'chip', 
					title : '芯片' 
				},
				{
					field : 'wuxian', 
					title : '无线充电' 
				},
				{
					field : 'volumes', 
					title : '容量' 
				},
				{
					field : 'fingerprint', 
					title : '解锁方式' 
				},
				{
					field : 'weight', 
					title : '重量' 
				},
				{
					field : 'sim', 
					title : '网络格式' 
				},
				{
					field : 'scoket', 
					title : '充电接口' 
				},
				{
					field : 'img', 
					title : '图片地址' 
				},
				{
					field : 'star', 
					title : '评星分数' 
				},
				{
					field : 'starSumCount', 
					title : '评星次数' 
				},
		        {
		            title: '操作',
		            align: 'center',
		            formatter: function(value, row, index) {
		            	var actions = [];
		            	actions.push('<a class="btn btn-success btn-xs ' + editFlag + '" href="#" onclick="$.operate.edit(\'' + row.phoneId + '\')"><i class="fa fa-edit"></i>编辑</a> ');
                        actions.push('<a class="btn btn-danger btn-xs ' + removeFlag + '" href="#" onclick="$.operate.remove(\'' + row.phoneId + '\')"><i class="fa fa-remove"></i>删除</a>');
						return actions.join('');
		            }
		        }]
            };
            $.table.init(options);
        });
    </script>
</body>
</html>